home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / IFC_112 / netscape / application / BrokenImageAttachment.java < prev    next >
Encoding:
Text File  |  1999-05-28  |  1.1 KB  |  38 lines  |  [TEXT/CWIE]

  1. // BrokenImageAttachment.java
  2. // By Ned Etcode
  3. // Copyright 1996, 1997 Netscape Communications Corp.  All rights reserved.
  4.  
  5. package netscape.application;
  6. import netscape.util.*;
  7. import java.net.*;
  8.  
  9.  
  10. /** Private class to display a broken image
  11.   */
  12. class BrokenImageAttachment extends TextAttachment {
  13.     private static int WIDTH  = 32;
  14.     private static int HEIGHT = 32;
  15.  
  16.     public int width() {
  17.         return WIDTH;
  18.     }
  19.  
  20.     public int height() {
  21.         return HEIGHT;
  22.     }
  23.     public void drawInRect(Graphics g, Rect boundsRect) {
  24.         Rect r = new Rect();
  25.         if (g == null || boundsRect == null) {
  26.             return;
  27.         }
  28.         g.setColor(Color.lightGray);
  29.         g.fillRect( boundsRect);
  30.  
  31.         g.setColor(Color.black);
  32.         g.fillRect(boundsRect.x,boundsRect.y, boundsRect.width , 1);
  33.         g.fillRect(boundsRect.x + boundsRect.width - 1, boundsRect.y, 1, boundsRect.height);
  34.         g.fillRect(boundsRect.x,boundsRect.y, 1,boundsRect.height);
  35.         g.fillRect(boundsRect.x,boundsRect.y + boundsRect.height-1,boundsRect.width,1);
  36.     }
  37. }
  38.